
#ifndef __LED_H
#define __LED_H


#include <string.h>

#include "mm32_device.h"
#include "hal_conf.h"
#include "app_process.h"



#define HT1621_USE 1	 //HT1621使能标志，1使能，0禁止

//LED_B
#define  LED_B_Port    GPIOA
#define  LED_B_Pin     GPIO_Pin_3
#define  LED_B_1   GPIO_SetBits(LED_B_Port,LED_B_Pin)
#define  LED_B_0   GPIO_ResetBits(LED_B_Port,LED_B_Pin)

//LCD--EN
#define  EN_Port    GPIOA
#define  EN_Pin     GPIO_Pin_1
#define  HBS1621_EN_1   GPIO_SetBits(EN_Port,EN_Pin)
#define  HBS1621_EN_0   GPIO_ResetBits(EN_Port,EN_Pin)

//LCD--DAT
#define  DAT_Port        GPIOA
#define  DAT_Pin         GPIO_Pin_10
#define  HBS1621_DAT_1   GPIO_SetBits(DAT_Port,DAT_Pin)
#define  HBS1621_DAT_0   GPIO_ResetBits(DAT_Port,DAT_Pin)

//LCD--CS
#define  CS_Port    GPIOA
#define  CS_Pin     GPIO_Pin_8
#define  HBS1621_CS_1   GPIO_SetBits(CS_Port,CS_Pin)
#define  HBS1621_CS_0   GPIO_ResetBits(CS_Port,CS_Pin)

//LCD--WR
#define  WR_Port    GPIOA
#define  WR_Pin     GPIO_Pin_9
#define  HBS1621_WR_1   GPIO_SetBits(WR_Port,WR_Pin)
#define  HBS1621_WR_0   GPIO_ResetBits(WR_Port,WR_Pin)



//HT1621与段屏接线
#define HT1621_ADDR0				0
#define HT1621_ADDR1				1
#define HT1621_ADDR2				2
#define HT1621_ADDR3				3
#define HT1621_ADDR4				4
#define HT1621_ADDR5				5
#define HT1621_ADDR6				6
#define HT1621_ADDR7				7
#define HT1621_ADDR8				8
#define HT1621_ADDR9				9
#define HT1621_ADDR10				10
#define HT1621_ADDR11				11
#define HT1621_ADDR12				12
#define HT1621_ADDR13				13
#define HT1621_ADDR14				14
#define HT1621_ADDR15				15
#define HT1621_ADDR16				16
#define HT1621_ADDR17				17
#define HT1621_ADDR18				18
#define HT1621_ADDR19				19
#define HT1621_ADDR20				20
#define HT1621_ADDR21				21
#define HT1621_ADDR22				22
#define HT1621_ADDR23				23
#define HT1621_ADDR24				24
#define HT1621_ADDR25				25
#define HT1621_ADDR26				26
#define HT1621_ADDR27				27
#define HT1621_ADDR28				28
#define HT1621_ADDR29				29
#define HT1621_ADDR30				30
#define HT1621_ADDR31				31











void HBS1621D_init(void);
void HBS1621D_Display(void);//显示
void HBS1621D_ENABLE(void);//LED点阵显示使能
void HBS1621D_DISABLE(void);//LED点阵显示禁止
void ClearAll_1621(u8 udata);
void SendCmd(u8 command);






#endif

